/**
* @project admin-go-api
* @name captcha
* @descriptions 验证码接口
* @author 寒锋
* @date 2023-12-13 16:43:40
 */

package controller

import (
	"admin-go-api/api/service"
	"admin-go-api/common/response"
	"github.com/gin-gonic/gin"
)

// Captcha 验证码
// @Summary 验证码接口
// @Produce json
// @Description 验证码接口
// @Success 200 {object} response.Result
// @Router /api/captcha [get]
func Captcha(c *gin.Context) {
	id, base64Image := service.CaptchaMake()
	data := map[string]interface{}{"id": id, "captcha": base64Image}
	response.Success(c, data)
}
